package com.example.lp.basemvp.model;

import android.util.Log;

import com.example.lp.basemvp.baseview.IBaseView;
import com.example.lp.basemvp.bean.Start;
import com.example.lp.lpmvp.R;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class StartModel implements IBaseModel<Start> {

    @Override
    public void getData(final OnLoaderListener<Start> loaderListener) {
        Log.e("StartModel", "模拟数据的请求: " );
        //模拟数据的请求
        new Thread(new Runnable() {
            @Override
            public void run() {
                ArrayList<Start> list = new ArrayList();
                int cout = 10;
                for (int i = 0; i < cout; i++) {
                    list.add(new Start("", R.drawable.testface, i * 1000));
                }
                Log.i("StartModel", "添加数据: " + Arrays.toString(list.toArray()));
                loaderListener.OnComplete(list);
            }
        }).start();

    }
}
